#include <iostream>
#include <stdio.h>
#include <string.h>

using namespace std;
int shu[10002];
int site[10002];
int n;

int main()
{
    int i, j, t;
    bool flag;
	while (1)
 	{
 	    scanf("%d:", &n);
 	    if (!n) break;
 	    memset(shu, 0, sizeof(shu));
 	    memset(site, 0, sizeof(site));
 	    flag = false;
 	    
 	    for (i=1; i<=n; ++i)
 	    {
 	    	scanf("%d", shu+i);
    		site[shu[i]]=i;
        }  		
        
        
        for (i=1; i<n-1; ++i)
        	for (j=n; j>i+1; j--)
       		{
       		    t = shu[i] + shu[j];
       		    if (t % 2 ==0)
       		    {
       		    	t /= 2;
       		    	if (site[t] && i < site[t] && site[t] < j)
       		    	{
       		    	    flag = true;
       		    	    goto end;
       		    	}    
       		    	
       		    }   	
  		    	
       		}   
		end:
  		if (flag) printf("no\n");
  		else printf("yes\n");
       		
          
 	    
    }        
    return 0;
}    


